package com.tanhua;

import com.tanhua.properties.*;
import com.tanhua.template.*;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author liuyp
 * @date 2021/06/09
 */
@Configuration
@EnableConfigurationProperties({AliyunSmsProperties.class,
                                OssProperties.class,
                                BaiduAipProperties.class,
                                HuanXinProperties.class,
                                BaiduCensorProperties.class})
public class TanhuaCommonsAutoConfiguration {

    @Bean
    public AliyunSmsTemplate smsTemplate(AliyunSmsProperties properties) {

        return new AliyunSmsTemplate(properties);
    }
    @Bean
    public OssTemplate ossTemplate(OssProperties ossProperties){
        return new OssTemplate(ossProperties);
    }
    @Bean
    public BaiDuAipTemplate baiDuAipTemplate(BaiduAipProperties baiduAipProperties){
        return new BaiDuAipTemplate(baiduAipProperties);
    }
    @Bean
    public HuanXinTemplate huanXinTemplate(HuanXinProperties huanXinProperties){
        return new HuanXinTemplate(huanXinProperties);
    }
    @Bean
    public BaiduCensorTemplate baiduCensorTemplate(BaiduCensorProperties properties){
        return new BaiduCensorTemplate(properties);
    }
}
